<?php

namespace app\api\controller\v1\user;

use app\common\controller\BaseController;
use think\Controller;
use think\Request;
use app\api\model\UserFile as UserFileModel;

class File extends BaseController
{
    protected $noNeedLogin = [''];

    /**
     * 我的课件
     */
    public function index()
    {
        $size = $this->request->get('size');
        $files = UserFileModel::getFilesByUserId($this->userId, $size);
        $files->total() ? $this->success('', [
            'files' => $files->items(),
            'total' => $files->total()
        ]) : $this->notFoundData();
    }
}
